<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
        "https://raw.githubusercontent.com/rbatis/rbatis/master/rbatis-codegen/mybatis-3-mapper.dtd">
<mapper>
    <select id="list_notes">
        select *
        from note
        where knowledge_base_id = #{knowledge_base_id}
        and is_delete = 0
        <if test="filter_text != null && filter_text != ''">
            ` and (title like '%' || #{filter_text} || '%'
                or summary like '%' || #{filter_text} || '%'
                or content like '%' || #{filter_text} || '%'
            )
            `
        </if>
        ` order by id desc`
    </select>
</mapper>